#include "filter_condition.h"
#include "ui_filter_condition.h"

Filter_condition::Filter_condition(QWidget* parent) :
    QDialog(parent),
    ui(new Ui::Filter_condition)
{
    ui->setupUi(this);
}

Filter_condition::~Filter_condition()
{
    delete ui;
}

void Filter_condition::on_buttonBox_accepted()
{
    emit sendData(ui->lineEdit->text(), ui->lineEdit_2->text(), axis);

    this->close();
}

void Filter_condition::on_radioButton_clicked()
{
    if (ui->radioButton->isChecked())
    {
        ui->radioButton_2->setChecked(false);
        ui->radioButton_3->setChecked(false);
        axis = "x";
    }
}

void Filter_condition::on_radioButton_2_clicked()
{
    if (ui->radioButton_2->isChecked())
    {
        ui->radioButton->setChecked(false);
        ui->radioButton_3->setChecked(false);
        axis = "y";
    }
}

void Filter_condition::on_radioButton_3_clicked()
{
    if (ui->radioButton_3->isChecked())
    {
        ui->radioButton_2->setChecked(false);
        ui->radioButton->setChecked(false);
        axis = "z";
    }
}